﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class loadCauHoi : System.Web.UI.Page
{
    public int MaDe = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int MaBaiThi = int.Parse(Session["BaiThi"].ToString());
            BaiThiINFO mBaiThi = BaiThiDAL.getInfo(MaBaiThi);
            loadDeThi(mBaiThi);
            MaDe = mBaiThi.MaDe;
        }
    }

    private void loadDeThi(BaiThiINFO mBaiThi)
    {
        DeThiINFO mDethi = DeThiDAL.GetInfo(mBaiThi.MaDe);
        lblDeThi.Text = mDethi.TenDe;
        string hide = "<input type='hidden' name='timeExpired' id='timeExpired' value='Norway' value='" + mDethi.ThoiGianThi + "' />";
        inputhide.Text = hide;
        mBaiThi.TinhTrang = 1;
        mBaiThi.ThoiGianBatDau = DateTime.Now;
        mBaiThi.ThoiGianThi = mDethi.ThoiGianThi;
        BaiThiDAL.Update(mBaiThi);
    }
}